package com.cccyy.date;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;

import java.util.Date;

/**
 * @author by zhoushupeng
 * @date 2019/07/05
 **/
public class DateMs {
    public static void main(String[] args) {
        System.out.println("当前时间:" + System.currentTimeMillis());
        Date today = new Date();
        System.out.println("当前时间:" + today.getTime());
        DateTime dateTime = DateUtil.beginOfMonth(today);

//        long diff = Math.abs(today.getTime() - dateTime.getTime());
//        System.out.println("相差:" + diff);  //毫秒值
        long l = DateUtil.betweenMonth(dateTime, today,true);
        System.out.println("相差:" + l);
    }

}
